<?php

class DefaultController extends Controller
{
	public function beforeAction($action)
	{
		$this->layout = Yii::app()->controller->module->layout;
		return true;
	}
	
public function filters()
	{
		return array(
			'accessControl', // perform access control for CRUD operations
		);
	}

	/**
	 * Specifies the access control rules.
	 * This method is used by the 'accessControl' filter.
	 * @return array access control rules
	 */
	public function accessRules()
	{
		return array(

			array('allow',  // allow all users to perform 'index' actions
				'actions'=>array('view'),
				'users'=>array('*'),
			),
		
			array('allow',  // allow all users to perform 'index' actions
				'actions'=>array('*'),
				'users'=>array('admin'),
			),
			array('deny',  // deny all users
				'users'=>array('*'),
			),
			
		);
	}
	
	public function actionIndex()
	{
		$this->render('index');	
	}
	public function actionAdmin()
	{
		$this->render('admin');	
	}

}
